function login() {
    $.blockUI({message: '<img class="loading-image" src="./images/loading.gif" /> 正在登录'});

    var data = $('#loginForm').serialize();
    $.ajax({
        type: 'POST',
        url: './login',
        data: data,
        success: function (result) {
            if (result.status === 20000) {
                window.location.href = './index';
            } else {
                $.unblockUI();
                layer.msg(result.message, {time: 2000});
            }

        }
    })
}